# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=scratch
pkgver=1.4.0.7
pkgrel=1
pkgdesc="Create and share your own interactive stories, games, music and art"
url="https://scratch.mit.edu"
arch="x86_64 armv7 s390x" # disabled for the other architectures due to compiling problems
license="GPL-2.0 AND CC-BY-SA AND MIT"
makedepends="make pango-dev glib-dev cairo-dev"
subpackages="$pkgname-doc"
options="!check" # make check not implemented
source="$pkgname-$pkgver.tar.gz::https://download.scratch.mit.edu/scratch-$pkgver.src.tar.gz"
builddir="$srcdir/$pkgname-$pkgver.src"

build() {
	make build
}

package() {
	install -Dm755 src/scratch "$pkgdir"/usr/bin/scratch
	install -Dm644 Scratch.image "$pkgdir"/usr/lib/$pkgname/Scratch.image
	install -m644 Scratch.ini "$pkgdir"/usr/lib/$pkgname/Scratch.ini
	install -Dm644 src/scratch.desktop "$pkgdir"/usr/share/applications/scratch.desktop
	install -Dm644 src/man/scratch.1.gz "$pkgdir"/usr/share/man/man1/scratch.1.gz
	install -Dm644 src/scratch.xml "$pkgdir"/usr/share/mime/packages/scratch.xml
	install -D -m644 src/icons/128x128/scratch.png "$pkgdir"/usr/share/icons/hicolor/128x128/apps/scratch.png

	mv Help/ locale/ Media/ Projects/ README Plugins/ "$pkgdir/usr/lib/scratch/"
}

sha512sums="a5dba21855ad2d087e0d76066ee70c6f36c67c66deccb6eb001249bc25391b0f9036d9fd2ab8383ef54c414e743dff23e9e52ab1c73dd7200f36d7d47c62f562  scratch-1.4.0.7.tar.gz"
